
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>安装 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="restMenu.html" />
    
    
    <link rel="prev" href="./" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="./">
            
                <a href="./">
            
                    
                    Angular-cli
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.2.1" data-path="Angular-cli.html">
            
                <a href="Angular-cli.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="restMenu.html">
            
                <a href="restMenu.html">
            
                    
                    初始结构
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../architecture/">
            
                <a href="../architecture/">
            
                    
                    架构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../architecture/mo-kuai.html">
            
                <a href="../architecture/mo-kuai.html">
            
                    
                    模块简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../architecture/component.html">
            
                <a href="../architecture/component.html">
            
                    
                    组件简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../architecture/Service.html">
            
                <a href="../architecture/Service.html">
            
                    
                    服务与依赖注入
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../comAndtem/">
            
                <a href="../comAndtem/">
            
                    
                    组件与模板
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../comAndtem/zu-jian-yu-mo-ban.html">
            
                <a href="../comAndtem/zu-jian-yu-mo-ban.html">
            
                    
                    数据显示与模板语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../comAndtem/cycle.html">
            
                <a href="../comAndtem/cycle.html">
            
                    
                    生命周期钩子
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../comAndtem/component.html">
            
                <a href="../comAndtem/component.html">
            
                    
                    组件交互
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../comAndtem/style.html">
            
                <a href="../comAndtem/style.html">
            
                    
                    组件样式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../comAndtem/dynamic.html">
            
                <a href="../comAndtem/dynamic.html">
            
                    
                    动态组件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../comAndtem/directive.html">
            
                <a href="../comAndtem/directive.html">
            
                    
                    属性指令与结构指令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="../comAndtem/pipeAndAnimit.html">
            
                <a href="../comAndtem/pipeAndAnimit.html">
            
                    
                    管道与动画
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../router/">
            
                <a href="../router/">
            
                    
                    路由与导航
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../form/">
            
                <a href="../form/">
            
                    
                    表单
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../http/">
            
                <a href="../http/">
            
                    
                    请求http
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../project/">
            
                <a href="../project/">
            
                    
                    项目解析:结构目录
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >安装</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h3 id="&#x5B89;&#x88C5;&#x524D;&#x63D0;&#x6761;&#x4EF6;">&#x5B89;&#x88C5;&#x524D;&#x63D0;&#x6761;&#x4EF6;</h3>
<p>&#x5728;&#x4F7F;&#x7528; Angular CLI &#x4E4B;&#x524D;&#xFF0C;&#x4F60;&#x5FC5;&#x987B;&#x786E;&#x4FDD;&#x7CFB;&#x7EDF;&#x4E2D; Node.js &#x7684;&#x7248;&#x672C;&#x9AD8;&#x4E8E; 6.9.0 &#x4E14; npm &#x7684;&#x7248;&#x672C;&#x9AD8;&#x4E8E; 3.0.0&#x3002;</p>
<p>&#x82E5;&#x4F60;&#x5C1A;&#x672A;&#x5B89;&#x88C5; Node.js&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x8BBF;&#x95EE; Node.js &#x5B98;&#x7F51;&#xFF0C;&#x7136;&#x540E;&#x6839;&#x636E;&#x4F60;&#x6240;&#x7528;&#x7684;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x9009;&#x62E9;&#x5BF9;&#x5E94;&#x7684;&#x5B89;&#x88C5;&#x65B9;&#x5F0F;&#x3002;</p>
<p>&#x82E5;&#x4F60;&#x672C;&#x673A;&#x5DF2;&#x7ECF;&#x5B89;&#x88C5; Node.js &#x548C; npm&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x8FD0;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#xFF0C;&#x786E;&#x8BA4;&#x4E00;&#x4E0B;&#x5F53;&#x524D;&#x73AF;&#x5883;&#x4FE1;&#x606F;&#xFF1A;</p>
<p><code>$ node - v # &#x663E;&#x793A;&#x5F53;&#x524D;Node.js&#x7684;&#x7248;&#x672C;</code></p>
<p><code>$ npm -v # &#x663E;&#x793A;&#x5F53;&#x524D;npm&#x7684;&#x7248;&#x672C;</code></p>
<p>&#x5F53;&#x4F60;&#x672C;&#x673A; Node.js &#x73AF;&#x5883;&#x786E;&#x8BA4;&#x65E0;&#x8BEF;&#x540E;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x5728;&#x547D;&#x4EE4;&#x884C;&#x4F7F;&#x7528; npm &#x5B89;&#x88C5; TypeScript&#xFF1A;</p>
<p><code>$ npm install -g typescript # &#x5B89;&#x88C5;&#x6700;&#x65B0;&#x7684;TypeScript&#x7A33;&#x5B9A;&#x7248;</code></p>
<h3 id="&#x5B89;&#x88C5;-angular-cli">&#x5B89;&#x88C5; Angular CLI</h3>
<ul>
<li><p>&#x5B89;&#x88C5; Angular CLI (&#x53EF;&#x9009;)</p>

</li>
</ul>
<p><code>npm install -g @angular/cli</code></p>
<ul>
<li><p>&#x68C0;&#x6D4B; Angular CLI &#x662F;&#x5426;&#x5B89;&#x88C5;&#x6210;&#x529F;</p>

</li>
</ul>
<p><code>ng --version</code></p>
<ul>
<li><p>&#x521B;&#x5EFA;&#x65B0;&#x7684;&#x9879;&#x76EE;</p>

</li>
</ul>
<p><code>ng new xxxxxxxxx // xxxxxxxxx you project name</code></p>
<p><img src="../assets/3020614-6192f68e63bbc7cc.png" alt="&#x521B;&#x5EFA;&#x4E2D;&#xFF0C;npm&#x4E5F;&#x5728;&#x4E0B;&#x8F7D;&#x76F8;&#x5173;&#x7684;&#x5305;&#xFF0C;&#x8010;&#x5FC3;&#x7B49;&#x5F85;">
&#x4E0A;&#x56FE;&#x5C31;&#x662F;&#x521B;&#x5EFA;&#x7684;&#x8FC7;&#x7A0B;&#xFF0C;&#x6B64;&#x65F6;&#x5728;&#x521B;&#x5EFA;&#x4E2D;&#xFF0C;npm&#x4E5F;&#x5728;&#x4E0B;&#x8F7D;&#x76F8;&#x5173;&#x7684;&#x5305;&#xFF0C;&#x8010;&#x5FC3;&#x7B49;&#x5F85;&#xFF1B;&#x4ECE;&#x63A7;&#x5236;&#x53F0;&#x4E2D;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x521B;&#x5EFA;&#x7684;&#x5185;&#x5BB9;&#xFF1B; </p>
<ul>
<li><p>&#x542F;&#x52A8;&#x672C;&#x5730;&#x670D;&#x52A1;&#x5668;</p>

<p>  <code>cd xxxxxxxxx</code><br>  <code>ng serve</code></p>
</li>
</ul>
<p>&#x6D4F;&#x89C8;&#x5668;&#x8F93;&#x5165; <a href="http://localhost:4200/" target="_blank">http://localhost:4200/</a> &#x5C31;&#x53EF;&#x4EE5;&#x770B;&#x5230;app works&#xFF01; </p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="./" class="navigation navigation-prev " aria-label="Previous page: Angular-cli">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="restMenu.html" class="navigation navigation-next " aria-label="Next page: 初始结构">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"安装","level":"1.2.1","depth":2,"next":{"title":"初始结构","level":"1.2.2","depth":2,"path":"Angular-cli/restMenu.md","ref":"Angular-cli/restMenu.md","articles":[]},"previous":{"title":"Angular-cli","level":"1.2","depth":1,"path":"Angular-cli/README.md","ref":"Angular-cli/README.md","articles":[{"title":"安装","level":"1.2.1","depth":2,"path":"Angular-cli/Angular-cli.md","ref":"Angular-cli/Angular-cli.md","articles":[]},{"title":"初始结构","level":"1.2.2","depth":2,"path":"Angular-cli/restMenu.md","ref":"Angular-cli/restMenu.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["fontsettings","sharing","lunr","search","highlight","livereload"],"pluginsConfig":{"fontsettings":{"family":"sans","size":2,"theme":"white"},"sharing":{"all":["facebook","google","twitter","weibo","instapaper"],"facebook":true,"google":false,"instapaper":false,"twitter":true,"vk":false,"weibo":false},"lunr":{"ignoreSpecialCharacters":false,"maxIndexSize":1000000},"search":{},"highlight":{},"livereload":{},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"Angular-cli/Angular-cli.md","mtime":"2018-06-12T06:43:23.267Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-06-29T06:02:19.129Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    

    </body>
</html>

